import { createRouter, createWebHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router';
import Index from './components/Index.vue';
import Login from './components/Login.vue';
import Register from './components/Register.vue';
import Favorites from './components/Favorites.vue';
import NewPost from './components/NewPost.vue';
import PostDetail from './components/PostDetail.vue';
import Profile from './components/Profile.vue';

const routes: Array<RouteRecordRaw> = [
  { path: '/', name: 'Index', component: Index },
  { path: '/login', name: 'Login', component: Login },
  { path: '/register', name: 'Register', component: Register },
  { path: '/favorites', name: 'Favorites', component: Favorites },
  { path: '/new-post', name: 'NewPost', component: NewPost },
  { path: '/post/:id', name: 'PostDetail', component: PostDetail },
  { path: '/profile', name: 'Profile', component: Profile },
  // 添加新的路由
  { path: '/discover', name: 'Discover', component: Favorites }, // 暂时使用Favorites组件
  { path: '/notifications', name: 'Notifications', component: Favorites } // 暂时使用Favorites组件
];

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
});

export default router;